<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/validation.jsp"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>${key.gathering}</title>
<script language="JavaScript" type="text/javascript"
	src="${ctx}/scripts/div/common.js"></script>
	<script type="text/javascript" src="${ctx}/scripts/jscalendar-1.0/calendar.js"></script>
<script type="text/javascript" src="${ctx}/scripts/jscalendar-1.0/lang/calendar-en.js"></script>
<script type="text/javascript" src="${ctx}/scripts/jscalendar-1.0/calendar-setup.js"></script>
<link rel="stylesheet" type="text/css" media="all" href="${ctx}/scripts/jscalendar-1.0/calendar-blue2.css" title="win2k-cold-1" />
<script type="text/javascript">

   function submitForm(){

     var isTrue=$("addGatheringForm").fireEvent("onSubmit");
      if(isTrue){
        document.getElementById("saveAgain").value="false";
        document.getElementById("addGatheringForm").submit();
      }
   }

   function saveAgainForm(){
     var isTrue=$("addGatheringForm").fireEvent("onSubmit");
      if(isTrue){
        document.getElementById("saveAgain").value="true";
        document.getElementById("addGatheringForm").submit();
      }
   }

   function closeWindow(){

      if(document.getElementById("saveAgain").value=="true"){
       var iframe=findFrame('${refreshIframe}');

       iframe.refresh();
      }
      windowClose();
   }

   function changeClass(ojb){
   if(ojb.value<0){
   Validation.changeElmValidate("remark","required max-length-500");
   }else{
   Validation.changeElmValidate("remark","max-length-500");
   }

   }

</script>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td width="121"><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle"><span class="window_head_intext">${key.gathering}</span></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td class="content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="aux_outtable_color"><table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
<form id="addGatheringForm" name="addGatheringForm" method="post" action="${ctx}/charge_cashieringAction.do?method=gatheringDeposit" class="required-validate">
  <input type="hidden" name="saveAgain" value="${saveAgain}">
    <input type="hidden" name="accountHouseId" value="${keyword}">
       <input type="hidden" name="keyword" value="${keyword}">
          <tr>
            <td class="aux_intable_td1">${key.houseNumber}</td>

             <td class="aux_intable_td2">

           <table border="0" cellspacing="0" cellpadding="0">

             <tr>
               <td ><script type="text/javascript">
               var iframe=findFrame('cashieringList');
                  document.write(iframe.getHouseNumber());
               </script>
             </td>
               <td width="4">&nbsp;</td>
               <td >&nbsp;</td>
             </tr>

           </table></td>
            </tr>
          <tr>
            <td class="aux_intable_td1">${key.ownerName}</td>

             <td  class="aux_intable_td2">
             <script type="text/javascript">
                  document.write(iframe.getOwnerName());
               </script>
             </td>

            </tr>

          <tr>
            <td class="aux_intable_td1"><span id="roomnum">${key.credit}</span></td>
            <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td ><input name="credit"  onChange="changeClass(this);" type="text" maxLength="14" class="required float-un-zero integer-decimal-range-14-2" style="text-align:right" value=""  size="16" afterInsert="debitTip"></td>
                <td width="4">&nbsp;</td>
                <td >元<span id="debitTip"></span></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td class="aux_intable_td1">${key.payMethods}</td>
            <td class="aux_intable_require">
            		<pms:unitedSelect id="businessId"
						name="businessId"
						dataList="${businessCodeList}"
						optionLabel="description"
						optionValue="keyword"
						className="select-one-required"
						selectText="${key.pleaseSelect}">
              		</pms:unitedSelect>
            </td>
          </tr>
          <tr>
            <td class="aux_intable_td1">${key.chargeDate}</td>
            <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td ><input name="chargeDate" type="text" class="required validate-date-yyyy-MM-dd validate-ajax" replaceId="dataValue"
                              validateUrl="${ctx}/common_sysrefcodeAction.do?method=compareCurrentDate&dateFormat=yyyy-MM-dd&compareType=smallEqualsCurrentDate" validateMessage="${key.message}" value="<fmt:formatDate pattern='yyyy-MM-dd' value='${defaultDate}'/>" size="16" afterInsert="consumeDateAfter"></td>
                <td width="4">&nbsp;</td>
                <td ><img id="imgConsumeDate" src="${ctx}/images/ico_clock.gif" width="20" height="20"><span id="consumeDateAfter"></span></td>
              </tr>
            </table></td>
          </tr>
          <tr>
            <td valign="top" class="aux_intable_td1">${key.remark}</td>
            <td align="left" class="aux_intable_td2">
              <textarea name="remark" cols="20" rows="4" class="max-length-500"></textarea>            </td>
          </tr>

</form>

        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td align="left" class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
      <tr>
        <!--  td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_41"></td>
              <td class="buttonOffMiddle" id="btn1_42" onClick="saveAgainForm();" onMouseOver="btn_change_over(4)" onMouseOut="btn_change_out(4)" onblur="btn_change(4)"><img src="${ctx}/images/ico_saveandnewfile.gif" alt="" width="14" height="14" border="0" align="absbottom">&nbsp;${key.saveAgain}</td>
              <td class="buttonOffRight" id="btn1_43"></td>
            </tr>
        </table></td-->
        <td class="btn_between_space">&nbsp;</td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_21"></td>
              <td class="buttonOffMiddle" id="btn1_22" onClick="submitForm();" onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onBlur="btn_change(2)"><img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom">${key.save}</td>
              <td class="buttonOffRight" id="btn1_23"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onClick="closeWindow();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onBlur="btn_change(3)"><img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom">${key.close}</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
<script type="text/javascript">
              Calendar.setup(
              {
	              inputField : "chargeDate", // ID of the input field
	              ifFormat : "%Y-%m-%d", // the date format
	              button : "imgConsumeDate", // ID of the button
	              align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );

</script>
</html>